

/** 游戏按钮文字 */

import { CsvManager_blxf } from "../Manager/CsvManager";
import { EnumManager_blxf } from "../Manager/EnumManager";
import { UtilsModule_blxf } from "../Module/UtilsModule";

const {ccclass, property} = cc._decorator;

@ccclass
export default class NewClass extends cc.Component {

    @property({ type: cc.Node, tooltip: '上货' })
    addShopText: cc.Node = null;

    @property({ type: cc.Node, tooltip: '送货' })
    buyShopText: cc.Node = null;

    @property({ type: cc.Node, tooltip: '卸货管理' })
    removeShopMagText: cc.Node = null;

    @property({ type: cc.Node, tooltip: '公益' })
    loveText: cc.Node = null;

    @property({ type: cc.Node, tooltip: '福帖' })
    coupletText: cc.Node = null;

    @property({ type: cc.Node, tooltip: '账本' })
    shopText: cc.Node = null;

    @property({ type: cc.Node, tooltip: '财富榜' })
    wealthText: cc.Node = null;
    
    @property({ type: cc.Node, tooltip: '升级' })
    lvUpText: cc.Node = null;

    @property({ type: cc.Node, tooltip: '装修' })
    renovationText: cc.Node = null;

    @property({ type: cc.Node, tooltip: '收益双倍' })
    rewardDoubleText: cc.Node = null;

    @property({ type: cc.Node, tooltip: '加速售卖' })
    speedDoubleText: cc.Node = null;

    @property({ type: cc.Node, tooltip: '查看库存' })
    viewVentoryText: cc.Node = null;

    @property({ type: cc.Node, tooltip: '装修' })
    roomRenovationText: cc.Node = null;

    // LIFE-CYCLE CALLBACKS:

    // onLoad () {}

    start () {
        this.updateUI_blxf();
    }

    // update (dt) {}

    updateUI_blxf () {
        let { TEXT_GAME_BTN1, TEXT_GAME_BTN2, TEXT_GAME_BTN3 } = EnumManager_blxf.gameTextType;
        let { TEXT_GAME_BTN11, TEXT_GAME_BTN12, TEXT_GAME_BTN13, TEXT_GAME_BTN14 } = EnumManager_blxf.gameTextType;
        let { TEXT_AUTO_BTN1, TEXT_AUTO_BTN2, TEXT_AUTO_BTN3, TEXT_AUTO_BTN4, TEXT_AUTO_BTN5 } = EnumManager_blxf.gameTextType;
        let { TEXT_ROOM_BTN1 } = EnumManager_blxf.gameTextType;

        this.setText_blxf( this.addShopText, TEXT_GAME_BTN1 );
        this.setText_blxf( this.buyShopText, TEXT_GAME_BTN2 );
        this.setText_blxf( this.removeShopMagText, TEXT_GAME_BTN3 );

        this.setText_blxf( this.loveText, TEXT_GAME_BTN11 );
        this.setText_blxf( this.coupletText, TEXT_GAME_BTN12 );
        this.setText_blxf( this.shopText, TEXT_GAME_BTN13 );
        this.setText_blxf( this.wealthText, TEXT_GAME_BTN14 );

        this.setText_blxf( this.lvUpText, TEXT_AUTO_BTN1 );
        this.setText_blxf( this.renovationText, TEXT_AUTO_BTN2 );
        this.setText_blxf( this.rewardDoubleText, TEXT_AUTO_BTN3 );
        this.setText_blxf( this.speedDoubleText, TEXT_AUTO_BTN4 );
        this.setText_blxf( this.viewVentoryText, TEXT_AUTO_BTN5 );

        this.setText_blxf( this.roomRenovationText, TEXT_ROOM_BTN1 );
    }

    setText_blxf ( textNode: cc.Node, textId: string ) {
        let _btnText: string = CsvManager_blxf.instance.getCfgText_blxf( textId );
        UtilsModule_blxf.setText_blxf( textNode, _btnText, 3 );
    }

}
